package com.seanchenxi.gwt.wordpress.xmlrpc.service;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.seanchenxi.gwt.wordpress.domain.model.PostList;
import com.seanchenxi.gwt.wordpress.domain.model.SimpleCategory;
import com.seanchenxi.gwt.wordpress.domain.model.TrackBackPing;

/**
 * The Interface MovableTypeLocalServiceAsync is a local implementation of MovableType API
 */
public interface MovableTypeLocalServiceAsync {

	/**
	 * Gets the category list.
	 * 
	 * @param blogId
	 *            the blog id
	 * @param username
	 *            the username
	 * @param password
	 *            the password
	 * @param callback
	 *            the callback
	 * @return the category list
	 */
	void getCategoryList(int blogId,
			AsyncCallback<ArrayList<SimpleCategory>> callback);

	/**
	 * Gets the recent post titles.
	 * 
	 * @param blogId
	 *            the blog id
	 * @param username
	 *            the username
	 * @param password
	 *            the password
	 * @param number
	 *            the number
	 * @param callback
	 *            the callback
	 * @return the recent post titles
	 */
	void getRecentPostTitles(int blogId,
			int number, AsyncCallback<ArrayList<PostList>> callback);

	/**
	 * Gets the post categories.
	 * 
	 * @param postId
	 *            the post id
	 * @param username
	 *            the username
	 * @param password
	 *            the password
	 * @param callback
	 *            the callback
	 * @return the post categories
	 */
	void getPostCategories(int postId,
			AsyncCallback<ArrayList<SimpleCategory>> callback);

	/**
	 * Sets the post categories.
	 * 
	 * @param postId
	 *            the post id
	 * @param username
	 *            the user name
	 * @param password
	 *            the password
	 * @param categories
	 *            the categories
	 * @param callback
	 *            the callback
	 */
	void setPostCategories(int postId,
			ArrayList<SimpleCategory> categories,
			AsyncCallback<Boolean> callback);

	/**
	 * Supported methods.
	 * 
	 * @param callback
	 *            the callback
	 */
	void supportedMethods(AsyncCallback<Object> callback);

	/**
	 * Gets the post's track back ping.
	 * 
	 * @param postId
	 *            the post id
	 * @param callback
	 *            the callback
	 * @return the trackback pings
	 */
	void getTrackbackPings(int postId,
			AsyncCallback<ArrayList<TrackBackPing>> callback);

	/**
	 * Publish post.
	 * 
	 * @param postId
	 *            the post id
	 * @param username
	 *            the username
	 * @param password
	 *            the password
	 * @param callback
	 *            the callback
	 */
	void publishPost(int postId,
			AsyncCallback<Integer> callback);

	/**
	 * In WordPress, this retrieve an empty array because we don't support
	 * per-post text filters.. So We don't implement this
	 */
	void supportedTextFilters();
}
